{literal}<script type="text/javascript" language="javascript">{/literal}
{$script}
{literal}</script>{/literal}
{$corpo_html_extrato}
<form id="form_empresa" name="form_empresa" method="post" action="{$_site.url}{$acao}">

	<table width="100%" border="0" cellspacing="0" cellpadding="0">                
    <tr>
      <td class="contForm">
      
		<table width="100%" border="0" cellspacing="2" cellpadding="4" id="tabela_extrato">
		   <tr class="bgDestaque terra">
		    	<td width="50%" valign="top" style="border:1px solid #CCCCCC; ">
		    		<table width="100%" cellpadding="3" cellspacing="0">
		    			<tr>
		    				<td valign="top"><img src="{$_site.url}public/images/logo_extrato.gif" alt="Alterar" border="0" title="Alterar"/></td>
		    			</tr>
		    			<tr>
		    				<td>{$unidade->vhr_nome} - CNPJ&nbsp;&nbsp;{$unidade->vhr_cnpj|aplicaMascara:"99.999.999/9999-99"}</td>
		    			</tr>
		    			<tr>
		    			<tr>
		    				<td>{$unidade->vhr_endereco}</td>
		    			</tr>
		    			<tr>
		    				<td>{$cidade_uf_unidade}, {$unidade->vhr_cep|aplicaMascara:"99999-99"}</td>
		    			</tr>
		    		</table>
		    	</td>
		    	<td width="50%" valign="top" style="border:1px solid #CCCCCC; ">
		    		<br></br>
		    		<table width="100%">
		    			<tr>
		    				<td width="26%" class="brod" nowrap="nowrap">DATA DE EMISS&Atilde;O</td>
		    				<td width="74%" class="bg_mercurio bordaFormResp">{$smarty.now|date_format:'%d/%m/%Y'}</td>
		    			</tr>
		    			<tr>
		    				<td class="brod" nowrap="nowrap">N&ordm;. DO EXTRATO</td>
		    				<td class="bg_mercurio bordaFormResp">{$num_extrato}</td>
		    			</tr>
		    			<tr>
		    				<td class="brod" nowrap="nowrap">DATA DE VENCIMENTO</td>
		    				<td class="bg_mercurio bordaFormResp">{$dte_vencimento}</td>
		    			</tr>
		    			<tr>
		    				<td class="brod">VALOR TOTAL</td>
		    				<td class="bg_mercurio bordaFormResp"><b>R$ {$valor_final|number_format:2:",":"."}</b></td>
		    			</tr>
		    		</table>
		    	</td>
		   </tr>
		   <tr class="bgDestaque terra">
		    	<td valign="top" style="border:1px solid #CCCCCC;">
					{if $tipo_pessoa == $codPessoaFisica}
		    		<table width="100%">
					   <tr>
					    	<td colspan="2" style="padding-bottom:8px;" valign="top"><b>Dados do cliente</b></td>
					   </tr>
		    			<tr>
		    				<td width="10%">CPF</td>
		    				<td width="90%" class="bg_mercurio bordaFormResp">{$pessoa->vhr_cpf|aplicaMascara:"999.999.999-99"}</td>
		    			</tr>
		    			<tr>
		    			<tr>
		    				<td>Nome</td>
		    				<td class="bg_mercurio bordaFormResp">{$pessoa->vhr_nomepessoa}</td>
		    			</tr>
		    			<tr>
		    				<td>Endere&ccedil;o</td>
		    				<td class="bg_mercurio bordaFormResp">{$endereco_fiscal->vhr_endereco}{if $parte != ""}&nbsp;-&nbsp;Parte&nbsp;"{$parte->vhr_nome}"{/if}</td>
		    			</tr>
		    			<tr>
		    				<td colspan="2"><br></br></td>
		    			</tr>
		    		</table>
					{/if}
					{if $tipo_pessoa == $codPessoaJuridica}
		    		<table width="100%" cellpadding="3" cellspacing="1">
					   <tr>
					    	<td colspan="2"  style="padding-bottom:8px;" valign="top"><b>Dados do cliente</b></td>
					   </tr>
		    			<tr>
		    				<td width="10%">CNPJ</td>
		    				<td width="90%" class="bg_mercurio bordaFormResp">{$pessoa->vhr_cnpj|aplicaMascara:"99.999.999/9999-99"}</td>
		    			</tr>
		    			<tr>
		    			<tr>
		    				<td>Respons&aacute;vel</td>
		    				<td class="bg_mercurio bordaFormResp">{$responsavel->vhr_nome}</td>
		    			</tr>
		    			<tr>
		    				<td>Nome</td>
		    				<td class="bg_mercurio bordaFormResp">{$pessoa->vhr_nomepessoa}</td>
		    			</tr>
		    			<tr>
		    				<td>Endere&ccedil;o</td>
		    				<td class="bg_mercurio bordaFormResp">{$endereco_fiscal->vhr_endereco}{if $parte != ""}&nbsp;-&nbsp;Parte&nbsp;"{$parte->vhr_nome}"{/if}</td>
		    			</tr>
		    		</table>
					{/if}
		    	</td>
		    	<td valign="top" style="border:1px solid #CCCCCC; ">
		    		<table width="100%" cellpadding="3" cellspacing="1">
					   <tr>
					    	<td colspan="2" style="padding:8px;">&nbsp;</td>
					   </tr>
		    			<tr>
		    				<td width="10%" nowrap="nowrap">Per&iacute;odo de apura&ccedil;&atilde;o</td>
		    				<td width="90%" class="bg_mercurio bordaFormResp">{$dte_inicio} - {$dte_fim}</td>
		    			</tr>
		    			<tr>
		    				<td>Plano</td>
		    				<td class="bg_mercurio bordaFormResp">{$plano->vhr_nome}</td>
		    			</tr>
		    			<tr>
		    				<td>Contrato</td>
		    				<td class="bg_mercurio bordaFormResp">n&ordm;. {$contrato->id}</td>
		    			</tr>
		    		</table>
		    		
		    	</td>
		   </tr>
		   <tr>
		    	<td valign="top" colspan="2">
		    		<table width="100%" cellpadding="3" cellspacing="2">
		    		   {if !empty($creditosservicos)}
						  <!--   <tr>
						    	<td colspan="5" class="credito">CR&Eacute;DITOS NO PER&Iacute;ODO</td>
						   </tr>
			    			<tr>
			    				<td class="bgDestaque" width="40%">Descri&ccedil;&atilde;o</td>
			    				<td class="bgDestaque" width="10%" align="center">Quantidade.</td>
			    				<td class="bgDestaque" width="10%" align="center">Unidade</td>
			    				<td class="bgDestaque" width="10%" align="center" nowrap="nowrap">-</td>
			    				<td class="bgDestaque" width="10%" align="center">-</td>
			    				<td class="bgDestaque" width="10%" align="center">Desconto  (R$)</td>
			    			</tr>
			      		    {assign var='bg1' value='#EFEFEF'}    
							{assign var='bg2' value=''}
							{assign var='i' value=1}
							
			    			foreach name=lista from=$creditosservicos item=creditoservico key=k
			    			{if $i++ is odd by 1}{assign var='bgcolor' value=$bg1}{else}{assign var='bgcolor' value=$bg2}{/if}
			    			<tr bgcolor="{$bgcolor}">
			    				<td>{$creditoservico.credito_servico_nome}</td>
			    				<td align="center">{$creditoservico.credito_servico_qtdehoras}</td>
			    				<td align="center">{$creditoservico.credito_servico_unidade}</td>
			    				<td align="center"> - </td>
			    				<td align="center"> - </td>
			    				<td class="credito" align="center">{$creditoservico.credito_servico_desconto|number_format:2:',':'.'}</td>
			    			</tr>
			    			
				      		/foreach
						   <tr>
						    	<td colspan="5"><br></td>
						   </tr> -->
			      	   {/if}
			      	   <tr>
					    	<td colspan="5"></td>
					   </tr>
					   <tr>
					    	<td colspan="5" class="debito"><b>Resumo de Despesas no per&iacute;odo</b></td>
					   </tr>
		    			<tr>
		    				<td class="bgDestaque" width="50%"><b>Descri&ccedil;&atilde;o</b></td>
		    				<td class="bgDestaque" width="5%" align="center" nowrap="nowrap">Quantidade</td>
		    				<td class="bgDestaque" width="5%" align="center" nowrap="nowrap">Unidade</td>
		    				<td class="bgDestaque" width="10%" align="center" nowrap="nowrap">Pre&ccedil;o Unitario (R$)</td>
		    				<td class="bgDestaque" width="10%" align="center" nowrap="nowrap">Data</td>
		    				<td class="bgDestaque" width="10%" align="center" nowrap="nowrap">Desconto (%)</td>
		    				<td class="bgDestaque" width="10%" align="center" nowrap="nowrap">Valor  (R$)</td>
		    			</tr>
		    			<tr bgcolor="#EFEFEF">
		    				<td>(-)&nbsp;Contrato Plano {$plano->vhr_nome}</td>
		    				<td class="debito" align="center">1</td>
		    				<td class="debito" align="center">{php} echo recuperarUnidadeMedida(Constantes::cteCodUnidadeMes){/php}</td>
		    				<td class="debito" align="center">{$valor_contrato|number_format:2:',':'.'}</td>
		    				<td class="debito" align="center">{$contrato->dte_assinatura|date_format:'%d/%m/%Y'}</td>
		    				<td class="debito" align="center">-</td>
		    				<td class="debito" align="center">{$valor_contrato|number_format:2:',':'.'}</td>
		    			</tr>
		    			{assign var='bg1' value='#EFEFEF'}    
						{assign var='bg2' value=''}
						{assign var='i' value=0}
						{assign var='j' value=0}
		    			
		    			{foreach name=lista from=$servicos item=servico key=k}
		    				{if $i++ is odd by 1}{assign var='bgcolor' value=$bg1}{else}{assign var='bgcolor' value=$bg2}{/if}
			    			<tr bgcolor="{$bgcolor}">
			    				<td class="" >(-)&nbsp;{$servico.nome_servico}</td>
			    				<td class="debito" align="center">{$servico.quantidade_servico}</td>
			    				<td class="debito" align="center">{$servico.unidade_servico}</td>
			    				<td class="debito" align="center">{$servico.valor_unitario_servico|number_format:2:',':'.'}</td>
			    				<td class="debito" align="center">{$servico.data_servico}</td>
			    				<td class="debito" align="center">{$servico.desconto_servico}</td>
			    				<td class="debito" align="center">{$servico.valor_servico|number_format:2:',':'.'}<!-- $servico.quantidade_servico*$servico.valor_unitario_servico|number_format:2:',':'.' --></td>
			    			</tr>
			    			<!-- foreach name=lista from=$creditosservicos item=creditoservico key=k
			    			{if !empty($servico.hora_credito_servico) && $servico.tipo_servico == $creditoservico.tipo_servico}
			    			{if $i++ is odd by 1}{assign var='bgcolor' value=$bg1}{else}{assign var='bgcolor' value=$bg2}{/if}
			    			<tr bgcolor="{$bgcolor}">
			    				<td class="">(+) Credito</td>
			    				<td class="credito" align="center">{$servico.hora_credito_servico}</td>
			    				<td class="credito" align="center"><span class="brod">{$creditoservico.credito_servico_unidade}</span></td>
			    				<td class="credito" align="center"> - </td>
			    				<td class="credito" align="center"> - </td>
			    				<td class="credito" align="center"> - </td>
			    			</tr>
			    			{/if}
				      		/foreach -->
			      		{/foreach} 
				      	{foreach name=lista from=$debitosajutesfinanceiros item=debitoajutefinanceiro key=k}
			    			{if $i++ is odd by 1}{assign var='bgcolor' value=$bg1}{else}{assign var='bgcolor' value=$bg2}{/if}
			    			<tr bgcolor="{$bgcolor}">
			    				<td>(-) {$debitoajutefinanceiro.motivo}</td>
			    				<td align="center">-</td>
			    				<td align="center">-</td>
			    				<td align="center">-</td>
			    				<td align="center">-</td>
			    				<td align="center">-</td>
			    				<td class="debito" align="center">{$debitoajutefinanceiro.valor|number_format:2:',':'.'}</td>
			    			</tr>
			    			
				      	{/foreach}
			      		{foreach name=lista from=$creditosservicos item=creditoservico key=k}
			      			{if $k == 0}
						    <tr>
						    	<td colspan="7"><br></br></td>
						    </tr>
						    <tr>
						    	<td class="bgDestaque"><b>Cr&eacute;dito(s) no periodo</b></td>
			    				<td class="bgDestaque" align="center" nowrap="nowrap">Quantidade</td>
			    				<td class="bgDestaque" align="center" nowrap="nowrap">Unidade</td>
			    				<td class="bgDestaque" align="center" nowrap="nowrap" colspan="3"></td>
			    				<td class="bgDestaque" align="center" nowrap="nowrap">Valor  (R$)</td>
			    				
						    	<!--<td class="bgDestaque" nowrap="nowrap"> -  Desconto (R$) --></td>
						    </tr>
						    {/if}
			    			{if $i++ is odd by 1}{assign var='bgcolor' value=$bg1}{else}{assign var='bgcolor' value=$bg2}{/if}
			    			<tr bgcolor="{$bgcolor}">
			    				<td>(+) {$creditoservico.credito_servico_nome}</td>
			    				<td class="credito" align="center">{$creditoservico.credito_servico_qtdehoras}</td>
			    				<td class="credito" align="center">{$creditoservico.credito_servico_unidade}</td>
			    				<td align="center">-</td>
			    				<td align="center">-</td>
			    				<td align="center">-</td>
			    				<td class="credito" align="center"> - <!-- $creditoservico.credito_servico_desconto|number_format:2:',':'.'  --></td>
			    			</tr>
				      	{/foreach}
				      	{foreach name=lista from=$creditosajutesfinanceiros item=creditoajutefinanceiro key=k}
			    			{if $i++ is odd by 1}{assign var='bgcolor' value=$bg1}{else}{assign var='bgcolor' value=$bg2}{/if}
			    			<tr bgcolor="{$bgcolor}">
			    				<td>(+) {$creditoajutefinanceiro.motivo}</td>
			    				<td align="center">-</td>
			    				<td align="center">-</td>
			    				<td align="center">-</td>
			    				<td align="center">-</td>
			    				<td align="center">-</td>
			    				<td class="credito" align="center">{$creditoajutefinanceiro.valor|number_format:2:',':'.'}</td>
			    			</tr>
			    			
				      	{/foreach}
					   <tr>
					    	<td colspan="7" class="bold debito"><br><br></td>
					   </tr>
					   <tr>
		    				<td class="bgDestaque debito" width="90%" colspan="5"><b>Saldo Devedor</b></td>
		    				<td class="bgDestaque" width="10%" align="center" colspan="2">Valor  (R$)</td>
		    		   </tr>
					   <tr>
		    				<td width="90%" colspan="5"></td>
		    				<td class="bgDestaque debito" width="10%" align="center" colspan="2"><b>R$ {$valor_final|number_format:2:",":"."}</b></td>
		    		   </tr>
					   <tr>
					    	<td colspan="6"><br></td>
					   </tr>
		    		   {if !empty($creditosrestantes)}
					   <tr>
					    	<td colspan="7" class="credito"><b>Cr&eacute;dito(s) restantes</b></td>
					   </tr>
		    			<tr>
		    				<td class="bordaFormResp" width="40%">Descri&ccedil;&atilde;o</td>
		    				<td class="bordaFormResp" width="10%" align="center">Quantidade</td>
		    				<td class="bordaFormResp" width="10%" align="center">Unidade</td>
		    				<td class="bordaFormResp" width="10%" align="center" nowrap="nowrap">-</td>
		    				<td class="bordaFormResp" width="10%" align="center">-</td>
		    				<td class="bordaFormResp" width="10%" align="center">-</td>
		    				<td class="bordaFormResp" width="10%" align="center"> -<!-- Desconto  (R$) --></td>
		    			</tr>
		      		    {assign var='bg1' value='#EFEFEF'}    
						{assign var='bg2' value=''}
						{assign var='m' value=1}
						
		    			{foreach name=lista from=$creditosrestantes item=creditorestante key=k}
		    			{if $m++ is odd by 1} 
						   {assign var='bgcolor' value=$bg1} 
						{else} 
						   {assign var='bgcolor' value=$bg2} 
						{/if}
		    			<tr bgcolor="{$bgcolor}">
		    				<td>{$creditorestante.credito_servico_nome}</td>
		    				<td align="center">{$creditorestante.credito_servico_qtdehoras}</td>
		    				<td align="center">{$creditorestante.credito_servico_unidade}</td>
		    				<td align="center"> - </td>
		    				<td align="center"> - </td>
		    				<td align="center"> - </td>
		    				<td class="credito" align="center"> -<!-- $creditorestante.credito_servico_desconto|number_format:2:',':'.' --></td>
		    			</tr>
			      		{/foreach}
					   <tr>
					    	<td colspan="5"><br></td>
					   </tr>
			      	   {/if}
		    		</table>
		    	</td>
		   </tr>
	    </table>
      </td>
    </tr>
	<tr>
      <td class="paddingTop15 paddingBottom15" align="center"><!-- === Botões ( Salvar e Limpar ) === -->
        <input type="button" value="Cancelar" onclick="cancelar(); return false;" class="botao">
          <!-- Final === Botões ( Salvar e Limpar ) === -->                      
       </td>
    </tr>
  </table>
</form>
